package cn.doitedu.javase.io;

import org.apache.commons.io.IOUtils;

import java.io.*;
import java.util.List;

public class _12_CommonsIO工具介绍 {
    public static void main(String[] args) throws Exception {


//        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("e:/a1.txt"), "GBK"));
//        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("e:/a2.txt"), "UTF-8"));
//        IOUtils.copy(reader,writer);
//        IOUtils.closeQuietly(reader);
//        IOUtils.closeQuietly(writer);


        List<String> lines = IOUtils.readLines(new FileInputStream("e:/a1.txt"), "GBK");
        for (String line : lines) {
            System.out.println(line);
        }

    }



}
